<?php
declare (strict_types=1);

namespace app\index\controller;

use app\common\model\UserCode as Code;

class UserCode extends Base
{
    /**
     * 发送短信验证码
     */
    public function sendSms()
    {
        $param = $this->request->post('', '', $this->filter);
        if (!$param['mobile']) {
            return json(['code' => -1, 'msg' => '手机号不能为空']);
        }

        return json(Code::sendMsgCode($param['mobile'], $param['action']));
    }
}